package com.lagou.job;

/**
 * 作业1: 创建程序员类
 */
public class Coder {
    //定义私有变量
    private int id;
    private double salary;
    //定义无参构造方法
    public Coder() {
    }
    //定义有参构造方法
    public Coder(int id, double salary) {
        setId(id);
        setSalary(salary);
    }
    //定义getter,setter方法
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public double getSalary() {
        return salary;
    }

    public void setSalary(double salary) {
        this.salary = salary;
    }
    //Coder类自定义函数
    public void work(){
        System.out.println("工号为" + id + "基本工资为" + salary + "的程序员方便正在努力的写着代码");
    }
}
